package com.bdtop.dbl.ui;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;

import com.bdtop.dbl.BaseActivity;
import com.bdtop.dbl.R;

public class ShareActivity extends BaseActivity {

	public static final void launch(Context context) {
		Intent intent = new Intent(context, ShareActivity.class);
		context.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_share);
		super.onCreate(savedInstanceState);

		mTitleBar.setTitle(R.string.share_1);
		
		findViewById(R.id.layout_contact).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				shareSms();
			}
		});
	}

	private void shareSms() {
		Uri smsToUri = Uri.parse("smsto:");
		Intent intent = new Intent(Intent.ACTION_VIEW, smsToUri);
		String shareText = getString(R.string.share);
		intent.putExtra("sms_body", shareText);
		intent.setType("vnd.android-dir/mms-sms");
		startActivity(intent);
	}
}
